<template>
  <div class="home-panel">
    <div class="container">
      <div class="head">
        <h3>
          畅销书籍<small>大厂专用 计信儿必读</small>
        </h3>
        <!-- 右侧内容区域 -->
        <a href="javascript:;">
          <small class="all">查看全部 >>></small>
        </a>
      </div>
      <!-- 主体内容区域 -->
      <div id="bookList">
        <div class="cptBook">
          <RouterLink to="product">
            <img src="../../../assets/images/C语言.png" alt="">
          </RouterLink>
        </div>
        <div class="cptBook">
          <RouterLink to="product">
            <img src="../../../assets/images/C++语言.png" alt="">
          </RouterLink>
        </div>
        <div class="cptBook">
          <RouterLink to="product">
            <img src="../../../assets/images/Python语言.png" alt="">
          </RouterLink>
        </div>
        <div class="cptBook">
          <RouterLink to="product">
            <img src="../../../assets/images/Go语言.png" alt="">
          </RouterLink>
        </div>
        <div class="cptBook">
          <RouterLink to="product">
            <img src="../../../assets/images/Java语言.png" alt="">
          </RouterLink>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { reactive, ref, defineExpose } from "vue";
export default {
  name: 'HomePanel',
  setup(){
    let titleList = reactive([{
      sub:"111",
      main:"222"
    }])
    defineExpose({titleList})
    return {titleList}
  }
}
</script>

<style scoped lang='less'>
.home-panel {
  background-color: #fff;

  .head {
    padding: 40px 0;
    display: flex;
    align-items: flex-end;

    h3 {
      flex: 1;
      font-size: 32px;
      font-weight: normal;
      margin-left: 6px;
      height: 35px;
      line-height: 35px;

      small {
        font-size: 16px;
        color: #999;
        margin-left: 20px;
      }
    }
    .all{
      font-size: 16px;
      color:#999;
      &:hover{
        color:@shopColor;
      }
    }
  }
}

#bookList {
  display: flex;
  width: 900px;
  height: 230px;
  margin: -10px auto;
  box-shadow: 7px 7px 15px #000;

  .cptBook {
    overflow: hidden;
    transition: .8s;
    width: 220px;

    &:hover {
      flex-shrink: 0;
      cursor: pointer;
    }
  }
}
</style>
